import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: HomeApp(),
    debugShowCheckedModeBanner: false,
  ));
}

class HomeApp extends StatelessWidget {
  const HomeApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Image 组件的使用'),
        leading: Icon(Icons.menu),
        backgroundColor: Colors.orange,
      ),
      body: Container(
        child: Center(
          child: Image.asset('qiche.png'),
          // 网络图片
          // Image.network(
          //   'https://ts2.cn.mm.bing.net/th?id=OIP-C.yRc2Y36MMA9H2yJ4eosTnAHaDU&w=220&h=104&c=7&bgcl=4450cb&r=0&o=6&pid=13.1',
          //   width: 300,
          //   height: 200,
          //   // fit: BoxFit.fill,
          //   fit: BoxFit.contain,
          //   // color: Colors.orange,
          // ),
        ),
      ),
      bottomNavigationBar: BottomNavigationBar(items: [
        BottomNavigationBarItem(
            icon: Icon(Icons.home), label: '首页', backgroundColor: Colors.red),
        BottomNavigationBarItem(
            icon: Icon(Icons.search), label: '搜索', backgroundColor: Colors.red),
        BottomNavigationBarItem(
            icon: Icon(Icons.person), label: '我的', backgroundColor: Colors.red)
      ]),
    );
  }
}
